package cos.android.tim.objects;

import java.util.Vector;

import android.graphics.Bitmap;
import cos.android.tim.element.DinamicElement;
import cos.android.tim.element.Element;
import cos.android.tim.element.Polygon;
import cos.android.tim.element.Ropeable;
import cos.android.tim.utils.Point;

public class Bucket extends Element {

	public Bucket(Bitmap sprite, Bitmap colisionSprite, Bitmap miniSprite,
			int xPos, int yPos, float flexibility, float weight, String kind) {
		super(sprite, colisionSprite, miniSprite, xPos, yPos, kind);
		this.setDinamicElement(new DinamicElement(flexibility, weight));
		this.setRopeable(new Ropeable(new Point(0 + (weight / 2), 0)));
		refreshAristas();
	}

	public void refreshAristas() {
		Vector<Point> aristas = new Vector<Point>();
		aristas.add(new Point(0, 19));
		aristas.add(new Point(getWidth(), 19));
		aristas.add(new Point(25, getHeight()));
		aristas.add(new Point(9, getHeight()));
		aristas.add(new Point(0, 19));
		this.setPolygon(new Polygon(aristas));
	}

}
